﻿@model IEnumerable<Game_MVC3.Models.News>
@using Game_MVC3.Code
@{
    ViewBag.Title = "Browser Game - News";
    Layout = "~/Views/Layouts/_Index.cshtml";
}

@section Head {
    <script type="text/javascript">
        $(function () {
            $('#news-accordion').accordion();
        });
    </script>
}

<h1>
    <img src="@Href("~/Images/content-icons/news.png")" alt="News" />
    News
</h1>



@if (Model.Count() > 0) {
    <div id="news-accordion" accordion="true">
    @foreach (var item in Model)
    {
        <h3><a href="#">@item.Title <span style="float: right;">@Helper.ToNewsDate(item.Date)</span></a></h3>
        <p>
            @Html.Raw(item.Text)
        </p>
    }
    </div>
} else {
    <br /><br />
    @Html.Raw(Helper.HtmlError("There are no News"))
}
